package org.plr.ecommerce.view;

import org.apache.wicket.ResourceReference;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.link.Link;
import org.plr.ecommerce.view.catalog.CatalogPage;
import org.plr.ecommerce.view.home.HomePage;

public abstract class Page extends WebPage {

    public Page() {
        Image logo = new Image("logo", new ResourceReference(Page.class, "images/logo.gif"));

        // TODO : get label in database.
        Label homeLabel = new Label("homeLabel", "Accueil");

        // TODO : get label in database.
        Label catalogLabel = new Label("catalogLabel", "Catalogue");

        Link homeLink = new BookmarkablePageLink("homeLink", HomePage.class);

        Link catalogLink = new BookmarkablePageLink("catalogLink", CatalogPage.class);

        add(logo);
        add(homeLink);
        add(catalogLink);
        homeLink.add(homeLabel);
        catalogLink.add(catalogLabel);
    }
}
